package design_pattern.chain.intercepterChain;

public class Client {
    public static void main(String[] args) {
	Request req = new Request();
	req.setEmail("lewis.liu@quest.com");
	req.setQQnumber("408674000");
	req.setPassword("123456");
	req.setConfirmPassword("123456");
	req.setUsername("lewis");
	
//	IntercepterChain chain = new IntercepterChain();
//	chain.addIntercepter(new EmailIntercepter()).addIntercepter(new QQnumberIntercepter());
//	chain.startChain(req);
	IntercepterChain chain1 = new IntercepterChain();
	chain1.addIntercepter(new PasswordIntercepter()).addIntercepter(new UsernameIntercepter());
//	chain1.startChain(req);
	
	IntercepterChain chain2 = new IntercepterChain();
	chain2.addIntercepter(new EmailIntercepter()).addIntercepter(chain1).addIntercepter(new QQnumberIntercepter());
	chain2.startChain(req);
    }
}
